package com.ruoyi.hazard.domain.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel("隐患数量分析返回对象")
public class HazardAmountAnalysisVo {

    @ApiModelProperty(value = "数据所属监狱ID")
    private Long deptId;
    @ApiModelProperty(value = "监狱名称")
    private String deptName;
    // 统计维度名称
    @ApiModelProperty(value = "隐患总量")
    private Integer countAmount;
    @ApiModelProperty(value = "已整改总量")
    private Integer finished;
    @ApiModelProperty(value = "未整改总量")
    private Integer unfinished;
    @ApiModelProperty(value = "已延期总量")
    private Integer delayed;
    @ApiModelProperty(value = "整改率")
    private BigDecimal finishedRate;

    public BigDecimal getFinishedRate(){
        return BigDecimal.valueOf(finished).divide(BigDecimal.valueOf(countAmount), 2, BigDecimal.ROUND_HALF_UP);
    }
}
